(1) Field of the Invention
This invention relates to a circuit for reading out address data applied to a memory in a one-chip microcomputer, more particularly to a circuit for reading out the readout address data of a memory in a one-chip microcomputer which does not have any address terminals but has input/output terminals to the outside.
(2) Description of the Prior Art
Generally, a one-chip microcomputer comprises a read-only memory (ROM) for storing a program and a program counter for executing the program by designating the addresses in the ROM. In mass-produced microcomputers, such as four-bit or eight-bit microcomputers (except evaluation chips for evaluating mass-produced chips), the ROM is a mask type ROM and the stored program is fixed in the mask ROM. Users generally do not have to rewrite or debug the stored program. Therefore, one-chip microcomputers do not have address output terminals for outputting the readout address of the ROM, i.e., the contents of the program counter (see, for example, TSM 1000 Series MOS/LSI ONE-CHIP MICROCOMPUTERS SOFTWARE USER'S GUIDE, TEXAS INSTRUMENTS Pages 1-1, 1-8 and 105). However, during the manufacture of one-chip microcomputers or during the shipment of manufactured microcomputers, it is often necessary to investigate the contents of the program counter for debugging, functional tests, mounting tests, or analysis of bad chips.
To enable investigation of the contents of the program counter from the outside of a one-chip microcomputer, terminals may be provided for outputting the addresses. However, the same number of terminals would be required for outputting addresses as the number of outputs of the program counter. When the memory capacity of a ROM is 4096 bytes, the program counter would have 12 outputs, as is known from the equation 4096=2.sup.12.
Users of mass-produced microcomputers do not need terminals for outputting addresses. Further, provision of terminals for outputting addresses would increase the number of input/output terminals of one-chip microcomputers. Therefore, it is not preferable to provide output terminals used only for outputting addresses.
An address output function could be provided to the original input/output terminals of one-chip microcomputers, but in this case, the wiring pattern would become so complex that the chip size would be increased.
Conventionally, the contents of the program counter of a one-chip microcomputer (except evaluation chips) have been investigated by using signals obtained when the program counter overflows. For example, when the program counter outputs 12 bits for specifying an address from 0 address to 4095 address of the ROM, it overflows after outputting data `FFF` (hexadecimal expression). Accordingly, when a jump instruction is provided, so that an address of, for example, `555` (hexadecimal expression) is specified by the program counter, and it is necessary to check whether the program counter correctly specifies the jumped address, it is necessary to wait until the program counter overflows, that is, it is necessary to wait for AAA steps (hexadecimal expression) because FFF-555=AAA. If the program counter correctly specified the jumped address, it provides an overflow signal after counting AAA from the jump instruction.
In this conventional method, therefore, while the contents of the program counter could be checked by counting the number of steps from the desired address to the overflow address, the necessity of waiting until the program counter overflows makes the time required to make this check long.